package com.x.reader.controller;

import com.x.framework.Base;
import com.x.framework.model.BaseView;
import com.x.framework.model.ResData;
import com.x.reader.model.Category;
import com.x.reader.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Controller
@RestController
public class CategoryController extends Base {

    @Autowired
    private CategoryService categoryService;

    @RequestMapping(value = "/SelectCategoryDataList")
    public ResData selectCategoryList(Category category) {
        List<Category> categoryList = categoryService.selectCategoryDataList(category);
        ResData resData = new ResData(1);
        resData.setResult(categoryList);
        return resData;
    }

}
